// member-card
const { BaseBehavior, COMPONENT_OPTIONS } = require('../../mixins/component');
const { PAGE_NAV } = require('../../constants/route');
const { navTo } = require('../../common/platform');

Component({
    behaviors: [BaseBehavior],
    options: {
        ...COMPONENT_OPTIONS,
    },
    properties: {
        cardInfo: {
            type: Object,
            value: null,
        },
        tipText: {
            type: String,
            value: '',
        },
        isOnlyShow: {
            type: Boolean,
            value: false,
        },
        isHaveCard: {
            type: Boolean,
            value: true,
        },
        isHaveButton: {
            type: Boolean,
            value: true,
        },
    },
    data: {

    },
    methods: {
        gotoDetail() {
            const { isOnlyShow } = this.data;
            !isOnlyShow && navTo(PAGE_NAV.cardDetail);
        },
        hopeAction() {
            // hope 操作
        },
        joinAction() {
            navTo(PAGE_NAV.cardJoin);
        },
        rechargeAction() {
            const { cardInfo } = this.data;
            navTo(PAGE_NAV.cardRecharge, {

            });
        },
    }
})
